package com.elephant.core.validation;

import lombok.Data;

import javax.validation.constraints.AssertTrue;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * @Author: hai
 * @Date: 2019/1/10 11:02
 */
@Data
public class Person {

    @NotNull(message = "姓名不能为空")
    private String name;
    @Min(value = 10, message = "不能小于10")
    @Max(value = 30, message = "不能大于30")
    private int age;
    @NotNull(message = "性别不能为空")
    private char sex;
    @AssertTrue(message = "必须是中国人")
    private boolean chinese;

}
